Skip to content

fix: scale Search Router Spend context with system font size - #97281

Merged
carlosmiceli merged 1 commit into
Expensify:mainfrom
nabi-ebrahimi:fix/97248-search-router-spend-font-scaling
Jul 28, 2026
Merged

fix: scale Search Router Spend context with system font size#97281
carlosmiceli merged 1 commit into
Expensify:mainfrom
nabi-ebrahimi:fix/97248-search-router-spend-font-scaling

Conversation

@nabi-ebrahimi

@nabi-ebrahimi nabi-ebrahimi commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Updates the Search Router’s right-side Spend context so its icon and text scale correctly with the system font size.

TextWithIconCell now accepts an optional icon size while retaining the existing 12px default for other callers. The Spend context uses the label font and matching icon size, preventing “Spend” from being clipped at maximum font size.

Fixed Issues

$ #97248
PROPOSAL: N/A

Tests

Maximum font size

Precondition: Set the device font size to maximum and use an account with at least one workspace.

  1. Open Search.
  2. Enter go to.
  3. Locate a Spend destination such as Expenses, Reports, or Drafts.
  4. Verify the Spend icon scales with the text.
  5. Verify “Spend” is fully visible and not clipped.
  6. Verify the icon and text are vertically aligned.
  • Verify that no errors appear in the JS console

Offline tests

Same as Tests.

QA Steps

Same as Tests.

// TODO: These must be filled out, or the issue title must include "[No QA]."

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native clip-fix
Android: mWeb Chrome android-web-clip-fix
iOS: Native
Screenshot 2026-07-29 at 1 49 52 AM
iOS: mWeb Safari
Screenshot 2026-07-29 at 1 50 53 AM
MacOS: Chrome / Safari macos-clip-fix

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
...s/Search/SearchRouter/useNavigationSuggestions.tsx 100.00% <100.00%> (ø)
...ts/Search/SearchList/ListItem/TextWithIconCell.tsx 0.00% <0.00%> (ø)
... and 60 files with indirect coverage changes

@nabi-ebrahimi
nabi-ebrahimi marked this pull request as ready for review July 28, 2026 21:20
@nabi-ebrahimi
nabi-ebrahimi requested review from a team as code owners July 28, 2026 21:20
@melvin-bot
melvin-bot Bot requested review from marufsharifi and removed request for a team July 28, 2026 21:20
@melvin-bot

melvin-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

@marufsharifi Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot requested review from JmillsExpensify and removed request for a team July 28, 2026 21:20
textStyle?: StyleProp<TextStyle>;
numberOfLines?: number;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ CONSISTENCY-2 (docs)

The new default parameter value iconSize = 12 is a magic number. The codebase already defines this exact value as a named constant, variables.iconSizeExtraSmall (which equals 12), and it is already used by other Search components (e.g. DropdownButton.tsx, WithdrawalIDListItemHeader.tsx). Using the raw literal here obscures its meaning and duplicates a value that lives in the style system.

Import variables and use the named constant as the default instead:

import variables from '@styles/variables';

export default function TextWithIconCell({icon, iconSize = variables.iconSizeExtraSmall, text, showTooltip, textStyle, numberOfLines = 1}: TextWithIconCellProps) {

Reviewed at: 62ea950 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

@carlosmiceli
carlosmiceli merged commit baa71aa into Expensify:main Jul 28, 2026
39 of 49 checks passed
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

OSBotify pushed a commit that referenced this pull request Jul 28, 2026
…spend-font-scaling

fix: scale Search Router Spend context with system font size
(cherry picked from commit baa71aa)

(cherry-picked to staging by roryabraham)
@OSBotify OSBotify added the CP Staging marks PRs that have been CP'd to staging label Jul 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚧 carlosmiceli has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/roryabraham in version: 9.4.45-9 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 No help site changes required.

I reviewed this PR against Expensify's help site files under App/docs/articles and no updates are needed.

Why: This is a purely visual fix. It makes the "Spend" context icon and text in the Search Router scale correctly with the system font size (so "Spend" isn't clipped at maximum font size) by adding an optional iconSize prop to TextWithIconCell and applying the label font in useNavigationSuggestions. There is:

  • No change to any user-facing feature, workflow, or capability
  • No new or renamed UI labels, tabs, settings, or buttons
  • No behavioral change a help article would document — only rendering/accessibility scaling

I also confirmed there are no existing articles in App/docs/articles describing the Search Router "Spend" context that this would affect.

Since no help site changes are required, I did not create a draft docs PR.

@nabi-ebrahimi, please confirm you agree no help site updates are needed here. If you believe a doc change is warranted, let me know what behavior should be documented and I'll create the draft PR.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/roryabraham in version: 9.4.45-10 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 No help site changes required (confirming my earlier review).

This PR is a purely visual fix — it makes the "Spend" context icon and text in the Search Router scale with the system font size so "Spend" isn't clipped at maximum font size. There's no change to any user-facing feature, workflow, terminology, setting, or button that a help article would document, and no existing article under App/docs/articles describes this UI element. No draft docs PR was created.

@nabi-ebrahimi, please confirm you agree no help site updates are needed here. If you believe a doc change is warranted, let me know what behavior should be documented and I'll create the draft PR.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/marcaaron in version: 9.4.45-14 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/roryabraham in version: 9.4.46-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

Help site review — no changes required

I reviewed the changes in this PR and no updates are needed to the help site files under docs/articles.

Why: This is a purely visual/accessibility fix. It makes the Spend context icon and label in the Search Router scale with the system font size (so "Spend" isn't clipped at maximum font size) by adding an optional iconSize prop to TextWithIconCell and using the label font size in useNavigationSuggestions. There is no change to any user-facing feature, workflow, setting, tab name, or label — only how the existing element renders at large font sizes.

Since the help site documents what features do and how to use them (not pixel-level rendering behavior), there's nothing to add or revise here. No draft PR was created.


@nabi-ebrahimi, no help site PR was created because this change doesn't affect any documented behavior. If you believe a specific article should still be updated, let me know which one and what it should say and I'll draft it.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/marcaaron in version: 9.4.46-10 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CP Staging marks PRs that have been CP'd to staging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants